import React, { useState } from 'react';
import {ExpandOutlined} from '@ant-design/icons';
const FullScreen = () => {
  const [isFullScreen, setIsFullScreen] = useState(false);
 
  const toggleFullScreen = () => {
    console.log("单机");
    if (!document.fullscreenElement) {
      // 进入全屏
      document.documentElement.requestFullscreen().then(() => {
        setIsFullScreen(true);
      });
    } else {
      // 退出全屏
      if (document.exitFullscreen) {
        document.exitFullscreen().then(() => {
          setIsFullScreen(false);
        });
      }
    }
  };
 
  return (
    <div>
     
      <ExpandOutlined style={{marginLeft:"16px"}} onClick={toggleFullScreen} />
    </div>
  );
};
 
export default FullScreen;